def get_frequency(chars):
    """
    获取词频
    :param chars: 源字符串
    :return: 词频对象
    """
    frequency_dict = {}
    for c in chars:
        if c in frequency_dict:
            frequency_dict[c] = frequency_dict[c] + 1
        else:
            frequency_dict[c] = 1
    return frequency_dict


def main():
    chars = input('请输入字符串：')
    frequency_dict = get_frequency(chars)
    print(frequency_dict)


main()
